<template>
  <div>
    <section @click="handleBannerClick">
      <img :src="bannerImg" alt="#">
      <div class="banner_info">
        <span class="banner_text">{{this.sightName}}</span>
        <div class="banner_icon">
          <span class="iconfont">&#xe60a;</span>
          <span>{{this.bannerImgs.length}}</span>
        </div>
      </div>
    </section>
    <common-fade>
      <common-gallary :imgs="bannerImgs" v-show="showGallary" @close="handleGallaryClose"></common-gallary>
    </common-fade>
  </div>
</template>
<script>
import CommonGallary from 'common/gallary/Gallary'
import CommonFade from 'common/fadeanimation/Fade.vue'
export default {
  name: 'DetailBanner',
  data () {
    return {
      showGallary: false
    }
  },
  props: {
    sightName: String,
    bannerImg: String,
    bannerImgs: Array
  },
  components: {
    CommonGallary,
    CommonFade
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>
<style lang="stylus" scoped>
section
  position: relative
  overflow: hidden
  height: 0
  padding-bottom: 55%
section img
  width: 100%
  height: 55vw
.banner_info
  position: absolute
  display: flex
  width:100%
  justify-content: space-around
  bottom: 0
  line-height: 2.0rem
  color: white
  font-size: 1.6rem
  background-image: linear-gradient(top, rgba(0, 0, 0, 0),rgba(0, 0, 0, .8))
.banner_icon
  display: inline-block
  padding: 0 .5rem
  margin-bottom: .1rem
  border-radius: .5rem
  background: rgba(0, 0, 0, .8)
</style>
